Repository navigation
Conversation
npm never includes files named .gitignore in a package, so generate failed when Fablo was installed from npm. Signed-off-by: Efeguclu1 <efeguclu3435@gmail.com>
When installed from npm, fablo.sh runs generator commands on the local Node.js instead of the Fablo Docker image. shfmt is optional. Signed-off-by: Efeguclu1 <efeguclu3435@gmail.com>
Signed-off-by: Efeguclu1 <efeguclu3435@gmail.com>
Signed-off-by: Efeguclu1 <efeguclu3435@gmail.com>
npm 11 removes bin entries starting with ./ when publishing, which left the published package without the fablo command. Signed-off-by: Efeguclu1 <efeguclu3435@gmail.com>
The workflow keeps the setup steps; the version check, dist-tag choice and publish live in a script that runs locally with DRY_RUN=1. lint.sh now shellchecks .github/scripts. Signed-off-by: Efeguclu1 <efeguclu3435@gmail.com>
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "name": "fablo", | |||
| "name": "@fablo-io/fablo", | |||
There was a problem hiding this comment.
we can actually use fablo - https://www.npmjs.com/package/fablo
| # provenance can only be generated inside GitHub Actions | ||
| if [ -n "${GITHUB_ACTIONS:-}" ]; then | ||
| publish_flags+=(--provenance) | ||
| fi |
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| registry-url: https://registry.npmjs.org | ||
|
|
||
| - name: Update npm (trusted publishing needs 11.5.1 or newer) | ||
| run: npm install --global npm@11 |
There was a problem hiding this comment.
to be checked if we can set npm version in actions/setup-node@v4
| const result = spawnSync("bash", [join(packageDir, "fablo.sh"), ...process.argv.slice(2)], { | ||
| stdio: "inherit", | ||
| env: { ...process.env, FABLO_PACKAGE_DIR: packageDir }, | ||
| }); |
There was a problem hiding this comment.
we don't want fablo.sh because is requires docker. We want to generate network without fablo container (assume fablo container is not available).
we should map fablo.sh commands/features to call node.js fablo sources/lib, without redundant Docker container layer.
| executeFabloGenerator() { | ||
| if [ -n "$FABLO_PACKAGE_DIR" ]; then | ||
| executeOnLocalFablo "$@" | ||
| else | ||
| executeOnFabloDocker "$@" | ||
| fi | ||
| } |
There was a problem hiding this comment.
it seems to call local node.js Fablo package, but the whole execution is:
- cal node.js
fablo - spawn process with
fablo.sh fablo.shcalls fablo node.js dist
instead node.js fablo should call fablo node.js dist directly
|
Tick the box to add this pull request to the merge queue (same as
|
…o image Signed-off-by: Efeguclu1 <efeguclu3435@gmail.com>
Fablo can now be installed from npm as
@fablo-io/fablo. When installed that way, generator commands (init,generate,validate, …) run on the local Node.js instead of the Fablo Docker image. The network itself still runs on Docker.Changes
package.json: renamed to@fablo-io/fablo; fixed thebinentry; addedfiles,enginesandprepackfablo.sh: runs generator commands locally when started from the npm packagedocker-entrypoint.sh: works outside the image;shfmtis optional.gitignoretemplates renamed togitignore, because npm never packs.gitignorefilestest-01-v3-simple.shnow runs from the packed npm packagepublish-npmjob inrelease-on-tag.yml(script:.github/scripts/publish-npm.sh); pre-releases go tonext